package jpa.entitys.promis.construction;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the GOODS_RETURN_NOTE_ITEMS database table.
 * 
 */
@Embeddable
public class GoodsReturnNoteItemPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=2)
	private String company;

	@Column(unique=true, nullable=false, length=30)
	private String project;

	@Column(name="GRT_TYPE", unique=true, nullable=false, length=2)
	private String grtType;

	@Column(name="GRT_SERIES", unique=true, nullable=false, length=4)
	private String grtSeries;

	@Column(name="GRT_NO", unique=true, nullable=false, precision=6)
	private long grtNo;

	@Column(name="SEQ_NO", unique=true, nullable=false, precision=3)
	private long seqNo;

    public GoodsReturnNoteItemPK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getProject() {
		return this.project;
	}
	public void setProject(String project) {
		this.project = project;
	}
	public String getGrtType() {
		return this.grtType;
	}
	public void setGrtType(String grtType) {
		this.grtType = grtType;
	}
	public String getGrtSeries() {
		return this.grtSeries;
	}
	public void setGrtSeries(String grtSeries) {
		this.grtSeries = grtSeries;
	}
	public long getGrtNo() {
		return this.grtNo;
	}
	public void setGrtNo(long grtNo) {
		this.grtNo = grtNo;
	}
	public long getSeqNo() {
		return this.seqNo;
	}
	public void setSeqNo(long seqNo) {
		this.seqNo = seqNo;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof GoodsReturnNoteItemPK)) {
			return false;
		}
		GoodsReturnNoteItemPK castOther = (GoodsReturnNoteItemPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.project.equals(castOther.project)
			&& this.grtType.equals(castOther.grtType)
			&& this.grtSeries.equals(castOther.grtSeries)
			&& (this.grtNo == castOther.grtNo)
			&& (this.seqNo == castOther.seqNo);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.grtType.hashCode();
		hash = hash * prime + this.grtSeries.hashCode();
		hash = hash * prime + ((int) (this.grtNo ^ (this.grtNo >>> 32)));
		hash = hash * prime + ((int) (this.seqNo ^ (this.seqNo >>> 32)));
		
		return hash;
    }
}